/* 
 * create_txthreads.c
 * Created on April 11, 2008; 3:23 PM
 * by VRamadurai
 */
#include <pthread.h>
#include <sched.h>
#include "HsTypes.h"


/** Stack for PHY **/
#define TX_STACKSIZE	(10*1024)


/** SB3500 TX THREADS **/
void* FnThread21(void *);
void* TxCtrl(void *);

void create_tx_threads()
{
    hs_int32_t siThreadSuccessFlag;
    static pthread_attr_t ThreadAttr;
    static struct sched_param sSched;
    static pthread_t thread_t;

    //Initialising thread attributes
    pthread_attr_init(&ThreadAttr);
    sSched.sched_priority = 0;
    pthread_attr_setschedpolicy(&ThreadAttr, SCHED_PIN); // Initialising thread attributes
    
    // Create 1 Tx thread: Core 1, TPU 1
    pthread_attr_setcore_sb(&ThreadAttr, 0);
    sSched.sched_cpuset = 1<<1;
    pthread_attr_setschedparam(&ThreadAttr,&sSched);
    pthread_attr_setstacksize(&ThreadAttr, TX_STACKSIZE); //10K
    siThreadSuccessFlag = pthread_create(&thread_t,&ThreadAttr,FnThread21,NULL);
    if(siThreadSuccessFlag != 0)
    {
       printf(" UnsuccessFull Thread Creation %d \n", siThreadSuccessFlag);
    }
}




    
